package com.maxsalad.common.service;

import com.maxsalad.common.message.MessageResult;
import com.maxsalad.uc.dao.ApiParameterDao;
import com.maxsalad.uc.em.Platform;
import com.maxsalad.uc.entity.ApiParameterEntity;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * Created by 2014-400 on 2016-03-15.
 */
public abstract class GeneralService {
    @Autowired
    protected ApiParameterDao apiParameterDao;


    protected List<ApiParameterEntity> getParameter(Platform platform) throws Exception {
        return apiParameterDao.getParameter(platform);
    }

    protected MessageResult getMessageResult(String code, Object... param) {
        return MessageResult.getMessage(code, param);
    }

    protected String getExMessage(Exception e) {
        return e.getMessage();
    }
}
